package com.cnoja.jmsncn.kernel;

import java.io.IOException;
import java.net.URI;

import sun.net.www.http.HttpClient;

import com.cnoja.jmsncn.kernel.exceptions.MessengerException;

public class HttpMessengerImpl extends AbstractMessenger{
	private URI URI = null;

	public HttpMessengerImpl(String userName,String password){
		super(userName,password);
	}
	
	
	public URI getURI() {
		return URI;
	}

	public void setURI(URI uri) {
		URI = uri;
	}

	public void login()throws MessengerException {
		HostConfiguration configuration = new HostConfiguration();
		configuration.setHost(this.URI);
		HttpClient client = new HttpClient();
		client.setHostConfiguration(configuration);

		HttpMethod method = new PostMethod();
		try {
			client.executeMethod(method);
		} catch (HttpException e) {
			e.printStackTrace();

		} catch (IOException e) {
			e.printStackTrace();
		}

	}


	public void logout() throws MessengerException {
		// TODO Auto-generated method stub
		
	}

	
	
	

}
